<<<<<<< HEAD
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 首页
 * @author chenhuan
 *
 */

class Welcome extends CI_Controller {

	public function index(){
		//var_dump('here');exit();
		//获取滚动图片
		$this->load->model('scrollpic_model');
		$vdata['scrollpic_list'] = $this->scrollpic_model->get_scrollpic_list_index();
		
		//获取标列表
		$this->load->model('Borrow_model');
		$this->load->model('User_model');
		$this->load->model('Credit_model');
		$this->load->model('Forum_model');
		
		$index_borrow_list_key = 'rsh_index_borrow_list3';
		$vdata['borrow_bill_bank'] 			= $this->Borrow_model->arrays('borrow_bill_bank');//银行
		$vdata['borrow_status'] 			= $this->Borrow_model->arrays('borrow_status');//状态
		$vdata['borrow_type'] 				= $this->Borrow_model->arrays('borrow_type');//标类型
		$vdata['borrow_style'] 				= $this->Borrow_model->arrays('borrow_style');//还款方式
		$vdata['borrow_fuse'] 				= $this->Borrow_model->arrays('borrow_fuse');//资金用途
		//标的安全等级
		$this->load->model('Conset_model');
		$vdata['borrow_fsafe'] 				= $this->Conset_model->get_credit_title_list();	
			// 正在借款中的标
			$adata['page_size']  = 6;
			$adata['page_start'] = 0;
			$adata['where']['is_check'] = 1;
			$adata['where']['is_verify'] = 1;
			$adata['where']['flag'] = "passing";
			$bdata3= $this->Borrow_model->get_zhs_index_borrow($adata);
		$vdata['borrow_list'] = $bdata3['borrow_list'];
		$vdata['first_borrow_list'] = $bdata3['borrow_list'][0];
		
		$this->load->model('site_model');
		$this->load->model('article_model');
		
		//获取公告
		$index_gonggao_key = 'rsh_index_gonggao_list';
		
		$gonggaosite = $this->site_model->get_site_one(array('url'=>'gonggao'));
		$cdata['where']['nid'] = $gonggaosite['id'];
		$article22_list = $this->article_model->get_article_list_index_limit($cdata);
		$vdata['article22_list'] = $article22_list;
		
		//媒体列表
		$meitissite = $this->site_model->get_site_one(array('url'=>'media'));
		
		$mparms['where']['nid'] = $meitissite['id'];
		$vdata['meiti_list'] = $this->article_model->get_article_list_index_limit($mparms);
		
		//投标总排行榜
		$rank_data_total['where']['start']=1435281180;
		$rank_data_total['where']['end']=time();
		$rank_data_total['page_start']=0;
		$rank_data_total['page_size']=10;
		$vdata['tender_rank_total'] = $this->Borrow_model->get_tender_rank($rank_data_total);

		//投标月排行榜	
		$dateStart=date('Y-m-01',strtotime("-1 month"));//上个月第一天
		$dateEnd=date('Y-m-30',strtotime("-1 month"));//上个月第三十天
		$rank_data_month['where']['start']=strtotime($dateStart);
		$rank_data_month['where']['end']=strtotime($dateEnd);
		$rank_data_month['page_start']=0;
		$rank_data_month['page_size']=10;
		$vdata['tender_rank_month'] = $this->Borrow_model->get_tender_rank($rank_data_month);

		//合作链接
		$this->load->model('Links_model');
		$type=1;
		$vdata['links1_list'] = $this->Links_model->get_links_list_by_type($type);
		
		//协作链接
		$type=2;
		$vdata['links2_list'] = $this->Links_model->get_links_list_by_type($type);
		
		//首页贷款统计
		// 累计成交额
		$this->load->model('Account_model');
		$tongji = $this->Account_model->deal_success();
		$vdata['deal_sucs_money'] 		= $tongji;
		
		// 累计收益总额
		$this->load->model('Account_model');
		$interest = $this->Account_model->deal_interest();
		$vdata['deal_sucs_interest'] 		= $interest;
		
		
		//获取用户资金信息
		if($this->session->userdata('rsh_user') != null){
			$user = $this->session->userdata('rsh_user');
			$this->load->model('Account_model');
			$vdata['user_account'] 	= $this->Account_model->get_account($user['user_id']);
			$tuser_account 			= $this->User_model->get_by_uid($user['user_id']);
			if($tuser_account == false){
				$tuser_account['paypassword'] = "";
			}else{
				$vdata['user_paypassword'] = $tuser_account['paypassword']; 
			}
			//收益总计
			$vdata['income_total'] =  $this->Account_model->income_total($user['user_id']);
		}
		
		//统计注册人数
		$vdata['reg'] = $this->User_model->reg_num();		
		
		//推广人员
		$invite = $this->input->get('invite');
		if ($invite){
			setcookie("inviteRequest",$invite, time()+3600);
		}		
		
		$vdata['tab'] = 'welcome';
		$vdata['title'] = CON_WEBNAME;
		$this->load->view('zhs_index', $vdata);
	}
}

=======
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 首页
 * @author chenhuan
 *
 */
class Welcome extends CI_Controller {

    public function index(){
		//获取滚动图片
		$this->load->model('scrollpic_model');
		$vdata['scrollpic_list'] = $this->scrollpic_model->get_scrollpic_list_index();
		
		//获取标列表
		$this->load->model('Borrow_model');
		$this->load->model('User_model');
		$this->load->model('Credit_model');
		$this->load->model('Forum_model');
		
		$index_borrow_list_key = 'rsh_index_borrow_list3';
		$vdata['borrow_bill_bank'] 			= $this->Borrow_model->arrays('borrow_bill_bank');//银行
		$vdata['borrow_status'] 			= $this->Borrow_model->arrays('borrow_status');//状态
		$vdata['borrow_type'] 				= $this->Borrow_model->arrays('borrow_type');//标类型
		$vdata['borrow_style'] 				= $this->Borrow_model->arrays('borrow_style');//还款方式
		$vdata['borrow_fuse'] 				= $this->Borrow_model->arrays('borrow_fuse');//资金用途
		//标的安全等级
		$this->load->model('Conset_model');
		$vdata['borrow_fsafe'] 				= $this->Conset_model->get_credit_title_list();	
			// 正在借款中的标
			$adata['page_size']  = 6;
			$adata['page_start'] = 0;
			$adata['where']['is_check'] = 1;
			$adata['where']['is_verify'] = 1;
			$adata['where']['flag'] = "passing";
			$bdata3= $this->Borrow_model->get_zhs_index_borrow($adata);
		$vdata['borrow_list'] = $bdata3['borrow_list'];
		$vdata['first_borrow_list'] = $bdata3['borrow_list'][0];
		
		$this->load->model('site_model');
		$this->load->model('article_model');
		
		//获取公告
		$index_gonggao_key = 'rsh_index_gonggao_list';
		
		$gonggaosite = $this->site_model->get_site_one(array('url'=>'gonggao'));
		$cdata['where']['nid'] = $gonggaosite['id'];
		$article22_list = $this->article_model->get_article_list_index_limit($cdata);
		$vdata['article22_list'] = $article22_list;
		
		//投标总排行榜
		$rank_data_total['where']['start']=1435281180;
		$rank_data_total['where']['end']=time();
		$rank_data_total['page_start']=0;
		$rank_data_total['page_size']=10;
		$vdata['tender_rank_total'] = $this->Borrow_model->get_tender_rank($rank_data_total);

		//投标月排行榜	
		$dateStart=date('Y-m-01',strtotime("-1 month"));//上个月第一天
		$dateEnd=date('Y-m-30',strtotime("-1 month"));//上个月第三十天
		$rank_data_month['where']['start']=strtotime($dateStart);
		$rank_data_month['where']['end']=strtotime($dateEnd);
		$rank_data_month['page_start']=0;
		$rank_data_month['page_size']=10;
		$vdata['tender_rank_month'] = $this->Borrow_model->get_tender_rank($rank_data_month);

		//媒体列表
		$meitissite = $this->site_model->get_site_one(array('url'=>'media'));		
		$mparms['where']['nid'] = $meitissite['id'];
		$vdata['meiti_list'] = $this->article_model->get_article_list_index_limit($mparms);
		
		//合作链接
		$this->load->model('Links_model');
		$type=1;
		$vdata['links1_list'] = $this->Links_model->get_links_list_by_type($type);
		
		//协作链接
		$type=2;
		$vdata['links2_list'] = $this->Links_model->get_links_list_by_type($type);
		
		//首页贷款统计
		// 累计成交额
		$this->load->model('Account_model');
		$tongji = $this->Account_model->deal_success();
		$vdata['deal_sucs_money'] 		= $tongji;
		
		// 累计收益总额
		$this->load->model('Account_model');
		$interest = $this->Account_model->deal_interest();
		$vdata['deal_sucs_interest'] 		= $interest;
		
		
		//获取用户资金信息
		if($this->session->userdata('rsh_user') != null){
			$user = $this->session->userdata('rsh_user');
			$this->load->model('Account_model');
			$vdata['user_account'] 	= $this->Account_model->get_account($user['user_id']);
			$tuser_account 			= $this->User_model->get_by_uid($user['user_id']);
			if($tuser_account == false){
				$tuser_account['paypassword'] = "";
			}else{
				$vdata['user_paypassword'] = $tuser_account['paypassword']; 
			}
			//收益总计
			$vdata['income_total'] =  $this->Account_model->income_total($user['user_id']);
		}
		
		//统计注册人数
		$vdata['reg'] = $this->User_model->reg_num();

		//2015/7/22日起，每天自动增加20左右注册人数
		$datetime1 = new Datetime('2015-7-22');
		$datetime2 = new Datetime(date('Y-m-d',time()));
		$interval = $datetime1->diff($datetime2);
		$autoReg_num = $interval->format('%a');
		$vdata['autoReg_num'] = $autoReg_num;		
		
		//推广人员
		$invite = $this->input->get('invite');
		if ($invite){
			setcookie("inviteRequest",$invite, time()+3600);
		}
		
		
		$vdata['tab'] = 'welcome';
		$vdata['title'] 		= CON_WEBNAME;
		$this->load->view('zhs_index', $vdata);
	}
	
}

>>>>>>> d47623b610d79a4eeb489500830c00d70933f414
